package com.letsrpg.wallhaven;

import android.app.ActionBar;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.facebook.drawee.drawable.ScalingUtils;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.letsrpg.wallhaven.provider.ImageUrls;

public class ImageActivity extends AppCompatActivity {
    private SimpleDraweeView mImageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image);

        View decorView = getWindow().getDecorView();
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);


        mImageView = (SimpleDraweeView) findViewById(R.id.image);
        String id = getIntent().getStringExtra("position");

        GenericDraweeHierarchy hierarchy = mImageView.getHierarchy();
        hierarchy.setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);


        Uri uri = Uri.parse(ImageUrls.getImageUrl(id));
        mImageView.setImageURI(uri);

    }


}
